// /////////////////////////////////////////////////////////////////////////////
//
// Name:            LuaFrame.h
// Author:          Michael Bartsch
//
// Desc :           The interface for the CLuaFrame class.
//
// License:         Copyright (C) 2008-2009 Michael Bartsch
//
//                  This program is free software: you can redistribute it
//                  and/or modify it under the terms of the GNU General Public
//                  License as published by the Free Software Foundation,
//                  either version 3 of the License, or (at your option) any
//                  later version.
//
//                  This program is distributed in the hope that it will be
//                  useful, but WITHOUT ANY WARRANTY; without even the implied
//                  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
//                  PURPOSE. See the GNU General Public License for more
//                  details.
//
//                  You should have received a copy of the GNU General Public
//                  License along with this program. If not, see
//                  <http://www.gnu.org/licenses/>.
//
// /////////////////////////////////////////////////////////////////////////////

#ifndef __C_LUAFRAME_H_INCLUDED__
#define __C_LUAFRAME_H_INCLUDED__

// Include required header file(s).
#include "../../Engine/Scripting/ScriptManager.h"
#include "../App.h"
#include "./MainFrame.h"


// Forward Declarations.
class CScriptManager;

class CMainFrame;

// Enumerations.
//! Widget ID's
enum LF_WidgetIDs
{
    LF_InputControl = 300,
    LF_OutputControl,
    LF_Menu_ResetCommands,
    LF_Menu_ClearTerminal,
    LF_Menu_ResetTerminal,
    LF_Menu_ResetClearTerminal
};


// The CLuaFrame class.
//! The Lua Frame which can be used to interact
//! with the Lua scripting language.
class CLuaFrame : public wxFrame
{
public:

    //! Constructor
    //! @param parent The window parent.
    CLuaFrame(wxWindow *parent);

    // Event functions.
    //! Handles the close event.
    void onClose(wxCloseEvent &event);
    //! Handles the "Open File" event of the "File" menu.
    void onOpen(wxCommandEvent &event);
    //! Handles the "Quit" event of the "File" menu.
    void onQuit(wxCommandEvent &event);

    //! Handles the "Reset Commands" event of the "Terminal" menu.
    void onResetCommands(wxCommandEvent &event);
    //! Handles the "Clear" event of the "Terminal" menu.
    void onClearTerminal(wxCommandEvent &event);
    //! Handles the "Reset" event of the "Terminal" menu.
    void onResetTerminal(wxCommandEvent &event);
    //! Handles the "Reset and Clear" event of the "Terminal" menu.
    void onResetClearTerminal(wxCommandEvent &event);

    //! Handles the submission of a command through the input box.
    void onSubmitInput(wxCommandEvent &event);


private:

    // Internal
    CMainFrame *frameParent;
    CScriptManager *pScriptManager;

    // wxWidgets objects.
    wxComboBox *inputControl;
    wxTextCtrl *outputControl;

    DECLARE_EVENT_TABLE()
};

#endif
